package stage1.module2;

public class Homework3TalkPlan extends Homework3Plan implements Homework3TalkInterface{
    private double talkTime;
    private int messageNumber;

    public Homework3TalkPlan(double talkTime, int messageNumber, double cost) {
        this.messageNumber = messageNumber;
        this.talkTime = talkTime;
        this.cost = cost;
    }

    @Override
    public void show(){
        System.out.printf("通话时长:%.2f, 短信条数:%d, 每月资费:%.2f", talkTime, messageNumber, cost);
        System.out.println();
    }

    @Override
    public void talk(double time, Homework3Card card) {
        card.setTalkTime(time);
        System.out.println("成功开通通话服务");
    }

    public double getTalkTime() {
        return talkTime;
    }

    public void setTalkTime(double talkTime) {
        this.talkTime = talkTime;
    }

    public int getMessageNumber() {
        return messageNumber;
    }

    public void setMessageNumber(int messageNumber) {
        this.messageNumber = messageNumber;
    }
}
